package com.fz.us.oa.core.dao.com.impl;

import com.fz.us.admin.company.dao.impl.BaseFlowDaoImpl;
import com.fz.us.oa.core.dao.com.OrderTrackDao;
import com.fz.us.oa.core.entity.com.OrderEntity;
import com.fz.us.oa.core.entity.com.OrderTrack;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by ZhuChunXiao on 2017/7/20.
 */
@Repository
public class OrderTrackDaoImpl extends BaseFlowDaoImpl<OrderTrack, String> implements OrderTrackDao {
    @Override
    public boolean checkRed(OrderEntity orderEntity) {
        List<OrderTrack> orderTracks=getSession().createQuery("from OrderTrack o where o.orderEntity=? and o.difficulty=2 and o.overcome=1")
                .setParameter(0, orderEntity)
                .list();
        if(orderTracks.size()>0){
            return true;
        }else{
            return false;
        }
    }
}
